Skip to content

fix(core): honor Codex input limits - #39545

Open
magoz wants to merge 1 commit into
anomalyco:v2from
magoz:codex-context-fix
Open

fix(core): honor Codex input limits#39545
magoz wants to merge 1 commit into
anomalyco:v2from
magoz:codex-context-fix

Conversation

@magoz

@magoz magoz commented Jul 29, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #38851

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Preserves models.dev's separate input limit through LLM routes. For ChatGPT OAuth, it overlays canonical openai-codex limits onto matching OpenAI models; API-key limits stay unchanged. Compaction uses input - buffer, and the TUI reports usage against that effective input window.

This makes GPT-5.6 Sol compact at 252K (272K input minus the existing 20K buffer), before the Codex backend ceiling. Depends on anomalyco/models.dev#3754.

Supersedes conflicting #38987 with the same Kit-authored patch rebased onto current v2.

How did you verify your code works?

  • Core focused tests: 38/38
  • TUI context tests: 4/4
  • AI, Core, TUI typechecks: pass
  • monorepo typecheck: 33/33 packages
  • full Core: 1490 pass, 6 skip; one unrelated WebFetch timeout passed isolated rerun 12/12
  • pre-push typecheck: pass

Screenshots / recordings

N/A; no visual layout change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found a related PR:

PR #38987: fix(core): honor Codex input limits
#38987

This is the PR that the current PR (39545) explicitly supersedes. According to the description: "Supersedes #38987: same Kit-authored patch, conflict-resolved onto current v2."

PR #39082: fix(opencode): correct Codex OAuth GPT-5.6 context window
#39082

This PR appears related as it also addresses GPT-5.6 context/input window handling in the Codex OAuth flow, which is directly relevant to the current PR's focus on honoring input limits for ChatGPT OAuth.

These are the closest related PRs; PR #38987 is the direct predecessor that was superseded by this current work.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@magoz

magoz commented Jul 29, 2026

Copy link
Copy Markdown
Author

Issue link note: the template now contains Closes #38851. GitHub still reports zero closingIssuesReferences because this PR targets v2, not default branch dev (same behavior on #38987), so automation retains needs:issue despite the linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants